<?php
use yii\helpers\Html;
use yii\helpers\Url;


$this->title = '权限列表';
$this->params['breadcrumbs'][] = $this->title;
$this->params['breadcrumbs'][] = $current_role->role_name;


?>
<?=Html::cssFile('@web/css/bootstrap-switch.css')?>
<?=Html::jsFile('@web/js/bootstrap-switch.js')?>
<?=Html::jsFile('@web/js/highlight.js')?>
<?=Html::jsFile('@web/js/main.js')?>

<div class="panel panel-default">
	   		<div class="panel-heading" >
            	<h3 class="panel-title" style="display:inline">用户权限管理列表</h3>
            	 <a class="pull-right panel-title" href="<?php echo Url::to(['role/index']);?>" style="display:block;text-decoration:none"> 
            	 	<input type="button" class="btn-sm btn-primary btn" value="返回用户列表页" >
            	 </a>       
        	</div>
        	 <div class="panel-body">    
        	 
        	 	<?= Html::beginForm(['role_access/update'], 'post') ?>
        	 		  <?php 
        	 		  	if(!empty($access_list))
        	 		  	{
        	 		  		foreach($access_list as $key => $value)
        	 		  		{
        	 		  	?>
        	 		  		<div class="list-group" style="width:30%; float:left;margin-left:5px;">
							  <a href="javascript:void(0);" class="list-group-item active">
							   <?php echo $value['name'];?>
							  </a>
			        	 		<?php 
					                 foreach ($value['node'] as $k => $v)
					                 {
					                      ?>
									  <a href="javascript:void(0);" class="list-group-item"><?php echo $v['name']?>  
									  	<input class="role_access" type="checkbox" <?php if($v['node_auth'] == 1){?> checked=checked<?php }?> name="role_access[<?php echo $key;?>__<?php echo $v['action'];?>]">
									  </a>
						
									 <?php 
					                   }
					              ?>      
							 </div>
        	 		  	<?php 
        	 		  		}
        	 		  	}
        	 		  ?>  	 
		    	
			    	<input type="hidden" name="role_id" value="<?php echo $current_role->id;?>" />
			    	 <div class="col-sm-12" style="text-align:center" >
                   		 <input type="submit" class="btn-primary btn"  name="submit" value="确定修改权限" >
                	</div>
		      <?= Html::endForm() ?>
		      
	    	</div>
</div>
  
